<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery 1.5 with long poll</title>
</head>
<body>
<div id="tip"></div>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.min.js"></script>
<script type="text/javascript">
$(function (){
 function log(resp){
  $("#tip").html("<b>" + resp + "</b>");
 }
 
 log("loading");
 
 // 去除缓存
    $.ajaxSetup({ cache: false });

 function initGet(){
  $.get("getNextTime")
    .success(function(resp){
   log(resp);
  }).error(function(){
   log("ERROR!");
  }).done(initGet);
 }
 
 initGet();
});
</script>
</body>
</html>